import pandas as pd

data = [1, 2, 3, 4, 5, 6]
index = ["a", "b", "c", "d", "e", "f"]
series = pd.Series(data, index=index, name="A")

# 1.Series类 统计, 计算, 排序方法
print("max:", series.max())  # 最大值
print("min:", series.min())  # 最小值
print("sum", series.sum())  # 求和
print("正序:", series.sort_values())  # 按值排序
print("反序:", series.sort_values(ascending=False))  # 反序排序
print("累计求和 cumsum:", series.cumsum())  # 累计求和
""" 
max: 6
min: 1
sum 21
正序:...

反序: f    6
e    5
d    4
c    3
b    2
a    1
Name: A, dtype: int64

累计求和 cumsum: a     1
b     3
c     6
d    10
e    15
f    21
Name: A, dtype: int64
"""